package com.test.redis.manager;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName RedisManager
 * @Author lulei
 * @Data 2020/3/10 21:20
 */

@Component
public class RedisManager {


    @Resource
    private StringRedisTemplate stringRedisTemplate;

    public void addKeyAddValue() {

        stringRedisTemplate.opsForValue().set("10001","张三");

    }

    public Object getValue() {

        String info = stringRedisTemplate.opsForValue().get("10001");

        return info;
    }

}
